package com.lei.retrofitdemo.network.exception;

/**
 * @author Lc
 * @description: 服务器远程异常, 如404, 500等
 * @date :2020/11/10 14:33
 */
public class ApiException extends Exception {
    private int code;//状态码
    private String displayMessage;//附加信息

    public ApiException(int code, String displayMessage) {
        this.code = code;
        this.displayMessage = displayMessage;
    }

    public ApiException(int code, String displayMessage, String message) {
        super(message);//父类Exception中的信息
        this.code = code;
        this.displayMessage = displayMessage;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDisplayMessage() {
        return displayMessage;
    }

    public void setDisplayMessage(String displayMessage) {
        this.displayMessage = displayMessage;
    }
}
